import {
  Injectable,
  NestMiddleware,
  UnauthorizedException,
} from '@nestjs/common'

@Injectable()
export class LoginValidateMiddleware implements NestMiddleware {
  use(req: any, res: any, next: () => void) {
    if (req.headers.authorization) {
      next()
    } else {
      throw new UnauthorizedException('没有权限1')
    }
  }
}
